home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / c_news / 17 / dice.pep < prev    next >
Text File  |  1989-08-23  |  433b  |  4 lines

  1. #include<stdlib.h>
  2. #include<stdio.h>
  3. #include<time.h>
  4. void main(int argc,char*argv[]){int roll,dice,count=0;if(argc==1){puts("\nProper format is:");puts("\n\n                  random n");puts("\n\nand n is an integer representing the number of ");puts("dice to be rolled.\n");exit(0);}dice=atoi(argv[1]);randomize();while(count<dice){roll=random(6);printf("The roll of dice number %d is %d",count+1,++roll);printf("\n");count++;}}